package com.zhengshang.api.service.impl;

import java.util.List;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppVersionMapper;
import com.zhengshang.api.domain.AppVersion;
import com.zhengshang.api.service.IAppVersionService;

/**
 * APP版本更新Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-03-23
 */
@Service
public class AppVersionServiceImpl implements IAppVersionService 
{
    @Autowired
    private AppVersionMapper appVersionMapper;

    /**
     * 查询APP版本更新
     * 
     * @param id APP版本更新ID
     * @return APP版本更新
     */
    @Override
    public AppVersion selectAppVersionById(Long id)
    {
        return appVersionMapper.selectAppVersionById(id);
    }

    /**
     * 查询APP版本更新列表
     * 
     * @param appVersion APP版本更新
     * @return APP版本更新
     */
    @Override
    public List<AppVersion> selectAppVersionList(AppVersion appVersion)
    {
        return appVersionMapper.selectAppVersionList(appVersion);
    }

    /**
     * 新增APP版本更新
     * 
     * @param appVersion APP版本更新
     * @return 结果
     */
    @Override
    public int insertAppVersion(AppVersion appVersion)
    {
        appVersion.setCreateTime(DateUtils.getNowDate());
        return appVersionMapper.insertAppVersion(appVersion);
    }

    /**
     * 修改APP版本更新
     * 
     * @param appVersion APP版本更新
     * @return 结果
     */
    @Override
    public int updateAppVersion(AppVersion appVersion)
    {
        appVersion.setUpdateTime(DateUtils.getNowDate());
        return appVersionMapper.updateAppVersion(appVersion);
    }

    /**
     * 批量删除APP版本更新
     * 
     * @param ids 需要删除的APP版本更新ID
     * @return 结果
     */
    @Override
    public int deleteAppVersionByIds(Long[] ids)
    {
        return appVersionMapper.deleteAppVersionByIds(ids);
    }

    /**
     * 删除APP版本更新信息
     * 
     * @param id APP版本更新ID
     * @return 结果
     */
    @Override
    public int deleteAppVersionById(Long id)
    {
        return appVersionMapper.deleteAppVersionById(id);
    }

    @Override
    public AppVersion getNewAppVersion(AppVersion appVersion) {
        return appVersionMapper.getNewAppVersion(appVersion);
    }

    @Override
    public int updateQrcode(AppVersion appVersion) {
        return appVersionMapper.updateQrcode(appVersion);
    }
}
